package com.changli05.objarr;

import java.util.Scanner;
public class StudentTest {
    public static void main(String[] args) {
        Student[] s = new Student[20];
//        Scanner sc = new Scanner (System.in);
        for (int i = 0; i <s.length ; i++) {
            s[i] = new Student();
            s[i].number = (int)(Math.random()*6+1);
            s[i].state = (int)(Math.random()*20+1);
            s[i].scores = (int)(Math.random()*101);
        }
        //封装 成utils
        StudentUtils utils = new StudentUtils();
//        utils.printStudentWithState(s,3);
        //排序前
        System.out.println("排序前");
        for (int i = 0; i < s.length; i++) {
            s[i].PrintInfo();
        }
        utils.sortScores(s);
        //排序后
        System.out.println("排序后");
        for (int i = 0; i < s.length; i++) {
            s[i].PrintInfo();
        }
    }
}
